home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / records.swg / 0013_Getting Record Offsets.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1995-03-26  |  298 b   |  21 lines

  1. {
  2. > Does anyone know how I can find and use the offset of
  3. > a given field in a record?
  4.  
  5. AFAIK, you can only use BASM for that. example:
  6. }
  7.  
  8. type
  9.  XXX=record
  10.   A,B,C:byte;
  11.  end;
  12. var
  13.  W:word;
  14. begin
  15.  asm
  16.   mov ax,XXX.A
  17.   mov W,ax
  18.  end;
  19.  { W holds now the offset of A in XXX }
  20. end.
  21.